<template>
	<!-- 人才自荐 -->
	<view class="rczj-list" :class="idmypublish?'rczj-list-idmypublish':''">
		<view class="row" v-for="(rmzy, index) in rczjData" :key="index">
			<view class="row-top" v-if="rmzy.member.avatar">
				<view class="left">
					<view class="head" @click="toPage(rmzy)">
						<image class="profilephoto" :src="rmzy.member?rmzy.member.avatar:rmzy.avatar" mode="widthFix">
						</image>
						<!-- VIP -->
						<image class="vip" v-if="rmzy.member.authStatus == '1' || rmzy.member.authStatus == '2' || rmzy.authStatus == '1' || rmzy.authStatus == '2'"
							src="https://luntan.xiaouyf.cn/uecs-wechat/static/img/qianduan/home_vip.png"
							mode="widthFix"></image>
					</view>
				</view>
				<view class="right">
					<view class="right-row-between">
						<!-- 姓名 -->
						<view class="name">{{ rmzy.member.realName || rmzy.realName }}</view>
						<!-- 认证 -->
						<view class="authenticated" v-if="rmzy.authStatus == '1' || rmzy.authStatus == '2'">
							<image src="https://luntan.xiaouyf.cn/uecs-wechat/static/img/qianduan/home_yrz.png"
								mode="widthFix"></image>
							<text>已实名</text>
						</view>
					</view>
					<view class="right-row">
						<!-- 城市 -->
						<view class="city">
							<image src="/static/images/address.png" mode="widthFix"></image> <text
								v-if="rmzy.city === '市辖区'">{{ rmzy.province }}</text>{{ rmzy.city || '-' }}
						</view>
					</view>
				</view>
			</view>
			<view class="row-bottom">
				<view v-if="rmzyTitle" class="row-tag-title">
					<view class="row-tag-title-left"><uni-icons type="star-filled" size="16"
							color="#AC6C17"></uni-icons>人才自荐</view>
					<!-- <view v-if="rmzy.releaseStatus" class="row-tag-title-right" :class="rmzy.releaseStatus === '审核中'?'audit-status-dsh'
					:rmzy.releaseStatus == '已通过'?'audit-status-ytg':'audit-status-wtg'">{{ rmzy.releaseStatus }}</view> -->
				</view>
				<!-- 	<view class="row-text">
					<view class="row-text-left" style="padding-left: 52rpx;">姓名：</view>
					<view class="row-text-right">{{ rmzy.realName }}</view>
				</view> -->
				<!-- <view v-if="rmzy.minute" class="animate">{{ rmzy.minute }}分钟前活跃</view> -->
				<!-- 				<view class="row-text">
					<view class="row-text-left" style="padding-left: 52rpx;">城市：</view>
					<view class="row-text-right">
						<uni-icons type="location-filled" size="14" color="#333"></uni-icons>
						<text v-if="rmzy.city === '市辖区'">{{ rmzy.province }}</text>{{ rmzy.city || '-' }}
					</view>
				</view> -->
				<view class="row-text">
					<view class="row-text-left">联系方式：</view>
					<view class="row-text-right">{{ rmzy.telephone }}</view>
				</view>
				<view class="row-text">
					<view class="row-text-left">自我介绍：</view>
					<view class="row-text-right">{{ rmzy.info }}</view>
				</view>
				<!-- 编辑、删除 -->
				<view v-if="idmypublish" class="row-edit-del">
					<view v-if="rmzy.releaseStatus !== '展示中'" class="block-btn" @click="editClick(rmzy)">
						<image src="https://luntan.xiaouyf.cn/uecs-wechat/static/img/qianduan/wdfb_bj.png"mode="widthFix"></image> 编辑
					</view>
					<view class="block-btn" @click="delClick(rmzy)">
						<image src="https://luntan.xiaouyf.cn/uecs-wechat/static/img/qianduan/wdfb_sc.png"mode="widthFix"></image> 删除
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "Rczj",
		data() {
			return {

			};
		},
		props: {
			rmzyTitle: {
				type: Boolean,
				default: true
			},
			// 数据
			rczjData: {
				type: Array,
				default: () => []
			},
			// 判断是否是我发布的
			idmypublish: {
				type: Boolean,
				debugger: false
			}
		},
		methods: {
			toPage(item) {
				// 检查登录状态
				if (!this.$store.state.user.isLoggedIn) {
					uni.showToast({
						title: '请先登录',
						icon: 'none'
					});
					// 跳转到我的页面
					setTimeout(() => {
						uni.redirectTo({
							url: '/pages/index/index'
						});
					}, 1500);
					return;
				}
				uni.navigateTo({
					url: `/pages/my-card/my-card?id=${item.member.guid}`
				})
			},
			// 编辑
			editClick(i) {
				this.$emit('on-edit', i);
			},
			// 删除
			delClick(i) {
				this.$emit('on-delete', i, '人才自荐');
			}
		}
	}
</script>

<style lang="less">
	// 人才自荐列表
	.rczj-list {
		margin-top: 20rpx;
		padding: 0 30rpx;

		&.rczj-list-idmypublish {
			padding: 0;

			.row {
				background-color: #FFF7EE;
				border-radius: 20rpx;
				padding: 20rpx 30rpx;
				.row-bottom {
					margin-top: 0;
					.row-tag-title{
						margin-bottom: 40rpx;
					}
				}
			}
		}

		.row {
			position: relative;
			display: flex;
			flex-direction: column;
			margin-bottom: 20rpx;

			.row-top {
				display: flex;
				align-items: center;

				.left {
					display: flex;
					flex-direction: column;
					margin-right: 40rpx;
					flex-shrink: 0;

					.head {
						position: relative;
						// 头像

						.profilephoto {
							width: 100rpx;
							height: 100rpx;
							border: 2rpx solid #D8A561;
							border-radius: 100%;
						}

						.vip {
							width: 38rpx;
							height: 31rpx;
							position: absolute;
							right: -10rpx;
							top: 4rpx;
						}
					}

				}

				.right {
					position: relative;
					flex: 1;
					display: flex;
					flex-direction: column;

					.right-row-between {
						display: flex;
						justify-content: space-between;

						// 姓名
						.name {
							font-size: 36rpx;
							margin-bottom: 18rpx;
							font-weight: bold;
							margin-top: 20rpx;
						}

						// 认证
						.authenticated {
							display: flex;
							align-items: center;
							font-size: 24rpx;
							color: #AC6C17;

							image {
								width: 21rpx;
								height: 24rpx;
								margin-right: 6rpx;
							}
						}
					}

					.right-row {
						display: flex;

						.city {
							font-size: 28rpx;
							color: #AC6C17;
							margin-top: 10rpx;
							margin-bottom: 25rpx;
							font-weight: bold;
							display: flex;
							align-items: center;

							image {
								width: 23.16rpx;
								height: 28rpx;
								margin-right: 10rpx;
							}
						}
					}
				}
			}

			.row-bottom {
				display: flex;
				flex-direction: column;
				margin-top: 25rpx;

				.row-text {
					display: flex;
					align-items: top;
					font-size: 28rpx;
					margin-bottom: 25rpx;

					&-left {
						color: #333;
					}

					&-right {
						flex: 1;
						display: flex;
						align-items: center;
						color: #333;
					}

					.uni-icons {
						margin-right: 5rpx;
					}
				}
			}

			// .right {
			// 	position: relative;
			// 	flex: 1;
			// 	display: flex;
			// 	flex-direction: column;

			// 	.name {
			// 		font-size: 32rpx;
			// 		font-weight: bold;
			// 	}

			// 	.animate {
			// 		position: absolute;
			// 		right: 10rpx;
			// 		top: 5rpx;
			// 		font-size: 26rpx;
			// 		color: #B8812F;
			// 	}

			// 	.row-text {
			// 		display: flex;
			// 		align-items: top;
			// 		font-size: 28rpx;
			// 		margin-bottom: 25rpx;

			// 		&-left {
			// 			color: #333;
			// 		}

			// 		&-right {
			// 			flex: 1;
			// 			display: flex;
			// 			align-items: center;
			// 			color: #000;
			// 		}

			// 		.uni-icons {
			// 			margin-right: 5rpx;
			// 		}
			// 	}
			// }
		}
	}
</style>